package com.baofang.bao.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baofang.bao.entity.Category;
import com.baofang.bao.entity.User;
import com.baofang.bao.repository.CategoryRepository;
@Service
public class CategoryServiceImpl implements IcategoryService {
	@Autowired
	private CategoryRepository categoryrepository;
	
	public List<Category> getUsers(){
		return categoryrepository.findAll();
	}
	
	public Category getUserById(Long id) {
		return categoryrepository.getOne(id);
	}
	
	public Category saveUser(Category category) {
		return categoryrepository.saveAndFlush(category);
	}
}
